package com.dream.wukong.common.core.interfaces.email;

import org.springframework.mail.MailException;

import javax.mail.internet.MimeMessage;
import java.io.InputStream;

/**
 * @Author: wuyichao
 * @Description:
 * @Date: Created in 10:58 2018/9/18.
 * @Modified:
 */
public interface IMailSendService {
    /**
     * 创建一个邮件体
     */
    MimeMessage createMimeMessage();

    /**
     * 用给定的邮件信息流创建一个邮件体
     */
    MimeMessage createMimeMessage(InputStream contentStream) throws MailException;

    /**
     * 发送一封邮件
     */
    void send(MimeMessage mimeMessage) throws MailException;

    /**
     * 发送一组邮件
     */
    void send(MimeMessage[] mimeMessages) throws MailException;

    /**
     * 发送一封由回调接口预处理的邮件
     */
    void send(MimeMessagePreparator mimeMessagePreparator) throws MailException;

    /**
     * 发送一组由回调接口预处理的邮件
     */
    void send(MimeMessagePreparator[] mimeMessagePreparators) throws MailException;

    /**
     * 发送一封简单的文本邮件
     */
    void send(SimpleMailMessage simpleMessage) throws MailException;

    /**
     * 发送一组简单的文本邮件
     */
    void send(SimpleMailMessage[] simpleMessages) throws MailException;

}
